#!/usr/bin/env python
# -*- coding:utf-8 -*-

import re
a="3*5/-2-(8*3/(20+3/2-5)+4/(3-2)*-3)"

#先取出最外层括号里的东西
r_kuohao=r'\([\d\+\-\*/\(\)]*\)'
a1 = re.findall(r_kuohao,a)  #a1=['(8*3/(20+3/2-5)+4/(3-2)*-3)']
for i in range(len(a1)):
    one = a1[i][1:-1]  #去括号 one='(8*3/(20+3/2-5)+4/(3-2)*-3)'
    #取下层括号里的东西
    two=re.findall(r_kuohao,one)
    print two
wai = re.split(r_kuohao,a)
#one = '8*3/(20+3/2-5)+4/(3-2)*-3'
print re.findall(r_kuohao,one)



#再下层，所以用循环，直到里面没有括号
#